<template> 
  <el-dialog 
    class="detail-dialog" 
    :visible.sync="isVisible" 
    :close-on-click-modal="false" 
    title="场所码修改日志详情" 
    width="800px">
    <div v-for="(item,index) in detailList" :key="index">
      <div class="d-title">
        <div class="title-l">
          <span v-if="item.updateType == '0'">修改前</span>
          <span v-else>修改后</span>
        </div>
        <div class="title-r">
          修改用户：<span>{{item.echoMap.updateHistoryBy}}</span>
        </div>
      </div>
      <el-row :gutter="24">
        <el-col :span="10">场所码编码：<span>{{item.csId}}</span></el-col>
        <el-col :span="12">场所码名称：<span>{{item.csName}}</span></el-col>
      </el-row>
      <el-row :gutter="24">
        <el-col :span="10">社会信用代码：<span>{{item.unifiedCode}}</span></el-col>
        <el-col :span="12">机构名称：<span>{{item.orgName}}</span></el-col>
      </el-row>
      <el-row :gutter="24">
        <el-col :span="10">申请时间：<span>{{item.createTime}}</span></el-col>
        <el-col :span="12">最后修改时间：<span>{{item.updateHistoryTime}}</span></el-col>
      </el-row>
      <el-divider></el-divider>
    </div>
  </el-dialog>
</template>

<script>
import {selectCsInfoHistoryDetail} from '@/http/apiUrls.js';
export default {
  name: 'CSMHistoryDetail',
  props: {
    // 弹窗显示
    dialogVisible:{
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      detailData: {},
      detailList: [],
    }
  },
  computed:{
    isVisible:{
      get(){
        return this.dialogVisible;
      },
      set(){
        this.$emit("close");
        this.detailData = {};
      }
    }
  },
  methods:{
     // 重置值
    initDetailObj(){
      return {
        userName: "",
      }
    },
    // 详情传递值
    setDetailObj(val){
      let requestData = {
        csId: val
      }
      // this.tabLoading = true;
      this.$postJson(selectCsInfoHistoryDetail, requestData).then(res => {
        // this.tabLoading = false;
        if(res){
          this.detailList = res;
        }
      })
    }
  }
}
</script>

<style lang="scss" >
.detail-dialog{
  .el-dialog__header{
    padding: 15px 20px 15px;
    .el-dialog__title{
      color: #fff;
    }
    i{
      color: #fff;
    }
    background-color: #006ACC;
  }

  .d-title{
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    .title-l{
      font-size: 16px;
      font-weight: 600;
    }
    .title-r{
      color: #006ACC;
    }
  }

  .el-row {
    margin-bottom: 12px;
    span {
      line-height: 16px;
    }
  }
}


</style>